package com.borko.healthcare.persistence.hibernate.services;

import java.util.List;

import com.borko.healthcare.entities.interfaces.Order;
import com.borko.healthcare.persistence.hibernate.dao.OrderDAO;

public class OrderManagerImpl implements OrderManager {
	
	private OrderDAO orderDAO;

	public OrderDAO getOrderDAO() {
		return this.orderDAO;
	}

	public void setOrderDAO(OrderDAO orderDAO) {
		this.orderDAO = orderDAO;
	}

	public void add(Order order) {
		orderDAO.create(order);
	}

	public void applyChanges(Order order) {
		orderDAO.update(order);
	}

	public List<Order> list() {
		return orderDAO.retrive();
	}

	public void remove(Order order) {
		orderDAO.delete(order);
	}

	public Order getOrder(int id) {
		return orderDAO.getOrder(id);
	}

}
